import request from '@/utils/requset'

// 获取当前用户角色
export const getUserRole = (): any => request({
  method: 'get',
  url: 'user-role'
})
// 获取角色列表
export const getRoleList = (data: any): any => request({
  method: 'post',
  url: '/role/list',
  data
})
// 删除角色
export const delRole = (id: any): any => request({
  method: 'post',
  url: '/role/del' + id
})
// 添加角色
export const addRole = (data: any): any => request({
  method: 'post',
  url: '/role/create',
  data
})
// 获取角色的菜单列表
export const getRoleMenu = (id: any): any => request({
  method: 'post',
  url: '/role-menu/role-in-menu' + id
})
// 编辑角色
export const updateRole = (id: number, data: any): any => request({
  method: 'post',
  url: '/role/update' + id,
  data
})
